package org.example.codegenerate.jpa;

/*import com.example.jpa.example1.WebGenerateModel;*/

import lombok.Data;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.*;
import java.time.Instant;

@Data
@MappedSuperclass
//@EntityListeners({AuditingEntityListener.class,EntityLoggingListener.class})
public class BaseEntityForFamliy {
	@Id
	@GeneratedValue(strategy= GenerationType.AUTO)
	private Long id;
	@CreatedBy //这个可能会被 AuditingEntityListener覆盖，为了方便我们测试，我们先注释掉
	private String createBy;
	@CreatedDate
	private Instant createTime;
	@LastModifiedBy
	private String updateBy;
	@LastModifiedDate
	private Instant updateTime;
	@Version //由于本身有乐观锁机制，这个我们测试的时候先注释掉，用我们手动设置的值；
	private Integer version;
	@Column(name = "sys_org_code", length = 64)
	private String sysOrgCode;
/*
	@PostUpdate
	public void postUpdate() {
		System.out.println("postUpdate::"+this.toString());
		System.out.println("BaseEntity:+WebGenerateModel.packageName:"+WebGenerateModel.packageName);

	}
*/

}
